/*
 *      network.h
 *      
 *      Copyright 2009 AzureSky <AzureSky.fedora@gmail.com>
 *      
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *      
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *      
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 *      MA 02110-1301, USA.
 */

#ifndef _NETWORK_H_
#define _NETWORK_H_

#include <sys/types.h>
#include <sys/sysctl.h>

typedef struct _tcp_mem{
			long min_mem;
			long default_mem;
			long max_mem;
		}tcp_mem;

class net_opt
{
	public:
		net_opt();
		~net_opt();
		
		/* enable/disable Selective Acknowledgment*/
		int about_ipv4_tcp_sack();
		int change_ipv4_tcp_sack(int);
		
		/* enable/disable Forward Acknowledgment*/
		int about_ipv4_tcp_fack();
		int change_ipv4_tcp_fack(int);
		
		/* enable/disable ip forward*/
		int about_ipv4_ip_forward();
		int change_ipv4_ip_forward(int);
		
		/* enable/disable tcp timestamps*/
		int about_ipv4_tcp_timestamps();
		int change_ipv4_tcp_timestamps(int);
		
		/* enable/disable RFC 1323  window scaling*/
		int about_ipv4_tcp_win_scaling();
		int change_ipv4_tcp_win_scaling(int);
		
		/* enable/disable tcp low_latency*/
		int about_ipv4_tcp_low_latency();
		int change_ipv4_tcp_low_latency(int);
		
		/* set the default rmem size*/
		long about_core_rmem_default();
		long change_core_rmem_default(long);
		
		/* set the max rmem size*/
		long about_core_rmem_max();
		long change_core_rmem_max(long);
		
		/* set the default wmem size*/
		long about_core_wmem_default();
		long change_core_wmem_default(long);
		
		/* set the max wmem size*/
		long about_core_wmem_max();
		long change_core_wmem_max(long);
		
		/* set the tcp mem size*/
		tcp_mem about_tcp_mem();
		tcp_mem change_tcp_mem(tcp_mem);
		
		/* set the tcp wmem size*/
		tcp_mem about_tcp_wmem();
		tcp_mem change_tcp_wmem(tcp_mem);
		
		/* set the tcp rmem size*/
		tcp_mem about_tcp_rmem();
		tcp_mem change_tcp_rmem(tcp_mem);
};

#endif //_NETWORK_H_
